<template>
  <div>
    <el-tree 
    show-checkbox
    default-expand-all
    check-strictly
    :data="list" 
    :props="{label:'name'}"
    
    ></el-tree>

  </div>
</template>

<script>
import {getPermissionList} from '@/api/permisson'
import {transDataToTreeData} from '@/utils'
export default {
  data() {
    return {
    list:[]
    };
  },
  created() {
    this.loadPermissionList()
  },
  methods: {
    async loadPermissionList(){
      try{
        const res=await getPermissionList()
        console.log('getPermissionList',res);
        this.list=transDataToTreeData(res.data)
      }catch(err){
      console.log('getPermissionList',err);
    }
    }
  },
}
</script>

